import {productListTopAction} from '../funnames'

const state = {
  productListTop: [],
}

const mutations = {
  [productListTopAction.ACTION_PRODUCT_TOP_ADD](state, data) {
    state.productListTop = state.productListTop.concat(data)
  },
  [productListTopAction.ACTION_PRODUCT_TOP_DELETE](state) {
    const size = state.productListTop.length
    if (size >= 1) {
      state.productListTop.pop()
    }
  }
}

const actions = {}

export default {
  state,
  mutations,
  actions
}
